﻿using M_Quality.API.Application.Command.QualityinspectionCommand;
using M_Quality.Domain;
using M_Quality.Repository.Impl;
using M_Quality.Repository.Interface;
using MediatR;

namespace M_Quality.API.Application.CommandHandler.QualityinspectionHandler
{
    public class QualityinspectionbackfillCommandHandler : IRequestHandler<QualityinspectionbackfillCommand, Qualityinspection>
    {
        protected readonly IQualityinspectionRepository qualityinspectionRepository;

        public QualityinspectionbackfillCommandHandler(IQualityinspectionRepository qualityinspectionRepository)
        {
            this.qualityinspectionRepository = qualityinspectionRepository;
        }

        public Task<Qualityinspection> Handle(QualityinspectionbackfillCommand request, CancellationToken cancellationToken)
        {
            var id = request.QualityinspectionId;
            var res = qualityinspectionRepository.GetModelAsync(id);
            return res;
        }
    }
}
